/*
  This simple class encapsulates the multimedia timers. 
  To use the class include mmTimers.cpp and mmTimers.h in your project. 
  Link with winmm.lib. To use a timer derive a class from CMMTimers 
  and override member timerProc. timerProc will be called when the timer goes off. 
  Instantiate a variable of the new class. 
  The parameter to the constructor is the timer resolution in ms. 
  To start a timer call startTimer. 
  The first parameter specifies the period of the timer in ms. 
  The second parameter specifies whether the timer is a one shot or periodic timer. 
  To stop a periodic timer call stopTimer. 
*/  


#ifndef	___multimedia_timers___
#define	___multimedia_timers___

#include	"StdAfx.h"
#include	<mmsystem.h>
#pragma comment(lib, "WinMM.Lib")



class CMMTimers
{
public:
	CMMTimers(UINT resolution);
	virtual ~CMMTimers();

	UINT	getTimerRes() { return timerRes; };

	bool	startTimer(UINT period,bool oneShot, LPTIMECALLBACK lpTimeProc);
	bool	stopTimer();	

protected:
	UINT	timerRes;
	UINT	timerId;
};


#endif